package com.qumoyugo.springframework.context.support;

import com.qumoyugo.springframework.beans.factory.support.DefaultListableBeanFactory;
import com.qumoyugo.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @author Cedric
 * @date 2021/11/24 14:49
 * @description 应用上下文对配置信息的加载
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext {

    @Override
   public void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);
        beanDefinitionReader.loadBeanDefinitions(getConfigLocations());
    }

    /**
     * 资源位置
     * @return 资源路径
     */
    protected abstract String[] getConfigLocations();
}
